<template>
	<div>
	    <el-pagination
	      @size-change="handleSizeChange"
	      @current-change="handleCurrentChange"
	      :current-page="parseInt(page.pageNo)"
	      :page-sizes="page.pageSizeOptions"
	      :page-size="parseInt(page.pageSize)"
	      layout="total, prev, pager, next, sizes,jumper"
	      :total="parseInt(page.recordCount)">
	    </el-pagination>
	    <div>
	    {{parentD}}
	    </div>
    </div>
</template>

<script>
	export default {
		props:["parentFn","parentData"],
		methods:{
			handleSizeChange(val){
				
			},
			handleCurrentChange(val){
				
			}
		},
		watch:{
			parentD:function(val,oldVal){
				this.parentD = this.parentFn(val)
			}
		},
		data(){
			return {
				parentD:this.parentData,
				 page:{
			    	pageNo:1,  //当前页码
			    	pageSize:10,  //每页条数
			    	recordCount:"0",  //数据总条数
			    	recordCountNo:"0",  //数据起始条
			    	totalPage:"0",  //总页数
			    	pageSizeOptions:[10, 20, 30,100,500],  //每页显示条数选项
			    	url:""  //接口地址
			    }
			}
		},
		mounted(){
			
			this.parentData = this.parentFn(parentData)
		}
	}
</script>

<style scoped>
	
</style>